Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

created CRUD to Actors table #1005

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Mxbely
Copy link

@Mxbely Mxbely commented Oct 19, 2024

No description provided.

Copy link

@Arsen-hrynevych Arsen-hrynevych left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

f"delete from {self.table_name} where id = ?",
(id_to_delete,)
)
self._connection.commit()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s important to close the database connection when you're done, either with a destructor (del) or by using context managers to ensure proper resource management.

Comment on lines +15 to +16
f"insert into {self.table_name} "
f"(first_name, last_name) values (?, ?)",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's best practice to write SQL queries in UPPERCASE for improved readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants